#pragma once
#include "./base.hpp"

void PrintStd(const char *str);
std::string GetStdInput();

class Reward:public HouseBase{
public:
	void Clear()override{};
	bool PassFunction(User& user,std::vector<Land>& map,std::unordered_map<int,User*>& users) override{
		if (user.GetStopNum()!=0) {
			return false;
		}
		PrintStd("恭喜你到达奖励屋，请选择你要获得的奖励(1/2/3)(获得2000$/获得200点数/财神附体)?");
		while (1) {
			auto get=GetStdInput();
			if (get!="1" && get!="2" && get!="3") {
				PrintStd("输入错误");
				break;
			}else if (get=="1") {
				user.SetMoney(user.GetMoney()+2000);
			}else if (get=="2"){
				user.SetCredit(user.GetCredit()+200);
			}else if (get=="3"){
				user.SetWealthNum(6);
			}
			break;
		}
		return false;
	};
	char MapChar() override{
		return 'G';
	};
	Color MapColor() override{
		return White;
	};
};
